package com.android.yummycookies.component.loadingScreen;

import android.content.Context;
import android.os.Handler;
import android.view.LayoutInflater;
import android.widget.FrameLayout;

import com.android.yummycookies.model.theme.Theme;

public abstract class AbstractThemeLoadingScreen extends FrameLayout {

	private final Theme theme;
	private final int heightToScale;
	private final int widthToScale;

	public AbstractThemeLoadingScreen(Context context, Theme theme,
			int heightToScale, int widthToScale) {
		super(context);

		LayoutInflater inflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		inflater.inflate(getLayoutId(), this);

		this.theme = theme;
		this.heightToScale = heightToScale;
		this.widthToScale = widthToScale;
	}

	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
		createDecoration();
	}

	public Theme getTheme() {
		return theme;
	}

	public int getHeightToScale() {
		return heightToScale;
	}

	public int getWidthToScale() {
		return widthToScale;
	}

	public abstract int getLayoutId();

	public abstract void createDecoration();

}
